/* $RCSFile: ADNDynUomSchedule.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynUomSchedule.cs $
 * $log$
 * Revision 19 2010/10/02 14:01:49  christian.surieux
 *   Corrected a bug in allmost everyADNDyn file for PrimaryFieldVualue
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
	public class ADNDynUomSchedule : DynEntity
	{
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.uomschedule)
            {}

            public override Type DynType
            { get { return typeof(ADNDynUomSchedule); } }

            public override string DynTypename
            {   get{ return CrmStr.uomschedule;}}

            public override DynEntity Build()
            {   return new ADNDynUomSchedule();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynUomSchedule(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynUomSchedule(w, PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynUomSchedule(w,PrimaryKeyValue);}
        }

        static ADNDynUomSchedule(){new Ftor();} 


        public override bool HasOwnerProperty
        {
            get{   return false;}
        }

        public override bool HasOwninguser
        {
            get{   return false;}
        }

        public override bool HasBusinessUnitProperty
        {
            get{   return false;}
        }

        public override bool OwningbusinessunitAsUniqueIdentifier
        {
            get{   return false;}
        }

        public ADNDynUomSchedule(): base()
		{}

        public ADNDynUomSchedule(CRMWrapperBase w, string PrimaryFiedlValue)
			: base(w, CrmStr.uomschedule)
		{
            if ( PrimaryFiedlValue != string.Empty )
                name    =   PrimaryFiedlValue;
		}

        public ADNDynUomSchedule(ResetWrapperHandler fn, string PrimaryFiedlValue)
			: base(fn, CrmStr.uomschedule)
		{
            if ( PrimaryFiedlValue != string.Empty )
                name    =   PrimaryFiedlValue;
		}

        public ADNDynUomSchedule(CRMWrapperBase w, Guid CrmId)
			: base(w,CrmStr.uomschedule,CrmId)
		{}

        public ADNDynUomSchedule(ResetWrapperHandler fn, Guid CrmId)
			: base(fn,CrmStr.uomschedule,CrmId)
		{}

		public ADNDynUomSchedule(CRMWrapperBase w, InternalDynamicEntity e)
			: base(w,CrmStr.uomschedule,e,null,null)
		{}

		public ADNDynUomSchedule(ResetWrapperHandler fn, InternalDynamicEntity e)
			: base(fn,CrmStr.uomschedule,e,null,null)
		{}

        public ADNDynUomSchedule(CRMWrapperBase w, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(w,CrmStr.uomschedule,e,prop,s)
		{}

        public ADNDynUomSchedule(ResetWrapperHandler fn, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(fn,CrmStr.uomschedule,e,prop,s)
		{}

		/// <summary>
		/// Crm Key
		/// </summary>
        [CrmDynAttribute(CrmStr.uomschedule)]
        public Guid uomscheduleid
		{
			get
			{
				return KeyPropertyValue(CrmStr.uomscheduleid);
			}
			set
			{
				AddKeyProperty(CrmStr.uomscheduleid, value);
			}
		}

        protected override void SetCrmIdProperty(Guid crmId)
        {
           if ( !dicProperty.ContainsKey(CrmStr.uomscheduleid) || KeyPropertyValue(CrmStr.uomscheduleid) != crmId )
                uomscheduleid   =   crmId;
        }
        
        public override string PrimaryFieldName
        {
            get
            {
               return CrmStr.name;
            }
           set
           {}
        }

        /// <summary>
        /// Value contained in the PrimaryField for the DynEntity or empty if no PrimaryField
        /// </summary>
        public override string PrimaryFieldStringValue
        {
            get
            {
                return name;
            }
            set
            {
                name =   value;
            }
        }

        public override Guid PrimaryKeyGuidValue
        {
           get
           {
                return uomscheduleid;
           }
           set
           {
               uomscheduleid    =   value;
           }
        }

        /// <summary>
        /// Gets or sets the description of the unit group.
        /// </summary>
        [CrmDynAttribute(CrmStr.uomschedule)]
        public string description 
        {
            get
            {
                return StringPropertyValue(CrmStr.description);
            }
            set
            {
                AddStringProperty(CrmStr.description,value);
            }
        }

        /// <summary>
        /// Gets or sets the name of the base unit.
        /// </summary>
        [CrmDynAttribute(CrmStr.uomschedule)]
        public string baseuomname
        {
            get
            {
                return StringPropertyValue(CrmStr.baseuomname);
            }
            set
            {
                AddStringProperty(CrmStr.baseuomname,value);
            }
        }
    }
}